package bean;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Barang {

    private String noBarang;
    private String jumlahBarang;
    private String beratbarang;
    private String jenisBarang;
    private String biayaKirim;

    public String getNoBarang() {
        return noBarang;
    }

    public void setNoBarang(String noBarang) {
        this.noBarang = noBarang;
    }

    public String getJumlahBarang() {
        return jumlahBarang;
    }

    public void setJumlahBarang(String jumlahBarang) {
        this.jumlahBarang = jumlahBarang;
    }

    public String getBeratbarang() {
        return beratbarang;
    }

    public void setBeratbarang(String beratbarang) {
        this.beratbarang = beratbarang;
    }

    public String getJenisBarang() {
        return jenisBarang;
    }

    public void setJenisBarang(String jenisBarang) {
        this.jenisBarang = jenisBarang;
    }

    public String getBiayaKirim() {
        return biayaKirim;
    }

    public void setBiayaKirim(String biayaKirim) {
        this.biayaKirim = biayaKirim;
    }

    public ResultSet tampilDataBarang() {

        Connection conn = koneksi.Koneksi.open();
        Statement state = null;
        try {
            state = conn.createStatement();
        } catch (SQLException ex) {
            Logger.getLogger(Barang.class.getName()).log(Level.SEVERE, null, ex);
        }
        String query = "select * from data_barang";
        ResultSet res = null;
        try {
            res = state.executeQuery(query);
        } catch (SQLException ex) {
            Logger.getLogger(Barang.class.getName()).log(Level.SEVERE, null, ex);
        }

        return res;
    }
}
